#!/usr/bin/perl
use LWP::Simple;
use HTML::Parse;


my $url;

if ($#ARGV==0)
{
    #The first thing you want to do is grab the 
    #config file for the wiki that you want to search
    #my $config_name = $ENV{ HOME }.'/.mw';

    #if (-e $config_name)
    #{
#	open(CONFIGFILE,$config_name);
#	while (<CONFIGFILE>)
#	{
#	    my $line = $_;
#	    chomp($line);
	    
#	    if ($line =~ m/<URL>(.*)<\/URL>/)
#	    {
#		$url = $1.$ARGV[0];
#	    }
#	}
 #   }
  #  else
   # {
	$url ='http://en.wikipedia.org/wiki/'.$ARGV[0];
    #}
    #This is the line that determines which wiki you grab from
    #my $url ='http://bulbapedia.bulbagarden.net/wiki/'.$ARGV[0];
    

    #gets the page contents
    my $ua = LWP::UserAgent->new();
    my $res = $ua->get($url);

    #prints the parsed contents
    print parse_html($res->content)->format;
    
}



